package com.asl.website.advantage.service.impl;

import java.util.List;
import com.asl.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.asl.website.advantage.mapper.SysAdvantageMapper;
import com.asl.website.advantage.domain.SysAdvantage;
import com.asl.website.advantage.service.ISysAdvantageService;

/**
 * 优势Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-22
 */
@Service
public class SysAdvantageServiceImpl implements ISysAdvantageService 
{
    @Autowired
    private SysAdvantageMapper sysAdvantageMapper;

    /**
     * 查询优势
     * 
     * @param advantageId 优势主键
     * @return 优势
     */
    @Override
    public SysAdvantage selectSysAdvantageByAdvantageId(Long advantageId)
    {
        return sysAdvantageMapper.selectSysAdvantageByAdvantageId(advantageId);
    }

    /**
     * 查询优势列表
     * 
     * @param sysAdvantage 优势
     * @return 优势
     */
    @Override
    public List<SysAdvantage> selectSysAdvantageList(SysAdvantage sysAdvantage)
    {
        return sysAdvantageMapper.selectSysAdvantageList(sysAdvantage);
    }

    /**
     * 新增优势
     * 
     * @param sysAdvantage 优势
     * @return 结果
     */
    @Override
    public int insertSysAdvantage(SysAdvantage sysAdvantage)
    {
        sysAdvantage.setCreateTime(DateUtils.getNowDate());
        return sysAdvantageMapper.insertSysAdvantage(sysAdvantage);
    }

    /**
     * 修改优势
     * 
     * @param sysAdvantage 优势
     * @return 结果
     */
    @Override
    public int updateSysAdvantage(SysAdvantage sysAdvantage)
    {
        sysAdvantage.setUpdateTime(DateUtils.getNowDate());
        return sysAdvantageMapper.updateSysAdvantage(sysAdvantage);
    }

    /**
     * 批量删除优势
     * 
     * @param advantageIds 需要删除的优势主键
     * @return 结果
     */
    @Override
    public int deleteSysAdvantageByAdvantageIds(Long[] advantageIds)
    {
        return sysAdvantageMapper.deleteSysAdvantageByAdvantageIds(advantageIds);
    }

    /**
     * 删除优势信息
     * 
     * @param advantageId 优势主键
     * @return 结果
     */
    @Override
    public int deleteSysAdvantageByAdvantageId(Long advantageId)
    {
        return sysAdvantageMapper.deleteSysAdvantageByAdvantageId(advantageId);
    }
}
